﻿using Furion.DatabaseAccessor;
using Microsoft.EntityFrameworkCore;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Htx.Fur.Core.Entities
{
    [Comment("用户表")]
    public class UserInfo : EntityBase, IEntitySeedData<UserInfo>
    {
        [MaxLength(64)]
        [Comment("姓名")]
        public string Name { get; set; }
        [Comment("编码")]
        public string Code { get; set; }
        //[Column(TypeName = "decimal(18,2)")]
        [Comment("年龄")]
        public int Age { get; set; }
        [Comment("地址")]
        public string Address { get; set; }

        /// <summary>
        /// 种子
        /// </summary>
        /// <param name="content"></param>
        /// <param name="dbContextLocator"></param>
        /// <returns></returns>
        public IEnumerable<UserInfo> HasData(DbContext content, Type dbContextLocator)
        {
            return new List<UserInfo>
            {
                new UserInfo{ Id = 1, Name = "孙小双", Code = "sunxiaoshuang", Age = 33, Address = "湖北省孝感市汉川市" },
                new UserInfo{ Id = 2, Name = "华天晓", Code = "huatianxiao", Age = 23, Address = "湖北省武汉市东湖高新区" },
            };
        }
    }
}
